//
//  MANetworkTool.h
//  MateAdv
//
//  Created by 茶 on 2023/9/8.
//

#import <Foundation/Foundation.h>


NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, MANetStatusType) {
    MANetStatusTypeUnKnown          = -1,
    MANetStatusTypeNotReachable      = 0,
    MANetStatusTypeWWAN             = 1,
    MANetStatusTypeWIFI             = 2,
};

@interface MANetworkTool : NSObject

/**请求头*/
@property (nonatomic, copy) NSDictionary *requestHeader;
/**超时时间， 默认30秒*/
@property (nonatomic, assign) NSTimeInterval timeoutInterval;
/**手动设置contentType*/
@property (nonatomic, copy) NSString *supportcontentType;
/**使用contentType:json*/
@property (nonatomic) BOOL jsonRequest;
/**
 获取网络状态
 
 @return 网络状态
 */
+ (MANetStatusType)ma_getNetStatus;

@property (nonatomic, copy) NSString *userUUID;


/**
 发起POST请求
 */
- (void)ma_post:(NSString *)urlString params:(nullable NSDictionary *)params successed:(void(^)(id object, BOOL isCache))successed failed:(nullable void(^)(NSError * error))failed;

@end

NS_ASSUME_NONNULL_END
